package co.com.jaco.entity.aas;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the privileges database table.
 * 
 */
@Embeddable
public class PrivilegePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="user_pk_code")
	private Integer userPkCode;

	@Column(name="role_pk_code")
	private Integer rolePkCode;

	public PrivilegePK() {
	}
	public Integer getUserPkCode() {
		return this.userPkCode;
	}
	public void setUserPkCode(Integer userPkCode) {
		this.userPkCode = userPkCode;
	}
	public Integer getRolePkCode() {
		return this.rolePkCode;
	}
	public void setRolePkCode(Integer rolePkCode) {
		this.rolePkCode = rolePkCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PrivilegePK)) {
			return false;
		}
		PrivilegePK castOther = (PrivilegePK)other;
		return 
			this.userPkCode.equals(castOther.userPkCode)
			&& this.rolePkCode.equals(castOther.rolePkCode);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.userPkCode.hashCode();
		hash = hash * prime + this.rolePkCode.hashCode();
		
		return hash;
	}
}